#ifndef __TITLE_BAR_H__
#define __TITLE_BAR_H__

#include "widget.h"

typedef struct title_bar
{
    // reference point where the user pressed the button
    POINT mouse_ref;
    // parent reference rectangle where the user pressed the button
    RECT parent_ref;
    uint8_t pressed;
} title_bar_t;

/*! Create the title bar
 * \param self: pointer to its widget
 * \param x: mouse coordinate
 * \param y: mouse coordinate
 * \param flag: virtual key status
 */
widget_t *create_title_bar(widget_t*,int32_t,int32_t,uint32_t,uint32_t);

/*! Callback function: title bar needs redrawing
 * \param self: pointer to its widget
 * \param hdc: widget client device context
 */
void title_bar_paint(widget_t*,HDC);

/*! Callback function: mouse left button pressed on the client area.
 * \param self: pointer to its widget
 * \param x: mouse coordinate
 * \param y: mouse coordinate
 * \param flag: virtual key status
 */
void title_bar_lbutton_down(widget_t*,int32_t,int32_t,uint32_t);

/*! Callack function: mouse have been moved over the widget clinet area
 * \param self: pointer to its widget
 * \param x: mouse coordinate
 * \param y: mouse coordiante
 * \param flag: virtual key status
 */
void title_bar_mouse_move(widget_t*,int32_t,int32_t,uint32_t);

/*! Callback function: mouse left button have been released
 * \param self: pointer to its widget
 * \param x: mouse coordinate
 * \param y: mouse coordinate
 * \param flag: virtual key status
 */
void title_bar_lbutton_up(widget_t*,int32_t,int32_t,uint32_t);

/*! Callback function: free allocated memory for the title bar
 * \param self: pointer to its widget
 */
void title_bar_free(widget_t*);

#endif /* __TITLE_BAR_H__ */

